package com.lingx.model.impl.interpreter;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.lingx.model.impl.AbstractInterpreter;
import com.lingx.service.LingxService;

//@Component
public class DownloadInterpreter extends AbstractInterpreter{
	@Resource
	private LingxService lingxService;

	public DownloadInterpreter() {
		super("DownloadInterpreter","文件下载解释器[外]");
	}
	@Override
	public Object input(Object value) throws Exception {
		// TODO Auto-generated method stub
		return value;
	}

	@Override
	public Object output(Object value) throws Exception {
		if(value==null)return "";
		String path=this.lingxService.getConfigValue("lingx.file.download.path", "http://127.0.0.1:9877/download/");
		return "<a target='_blank' href='"+path+value.toString()+"'>文件下载</a>";
	}

}
